Optimal. Leaf size=33 \[ 2 a b x+\frac {a^2 \tanh ^{-1}(\sin (c+d x))}{d}+\frac {b^2 \sin (c+d x)}{d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.04, antiderivative size = 33, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 3, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.158, Rules used = {2825, 2814,
3855} \begin {gather*} \frac {a^2 \tanh ^{-1}(\sin (c+d x))}{d}+2 a b x+\frac {b^2 \sin (c+d x)}{d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2814
Rule 2825
Rule 3855
Rubi steps
\begin {align*} \int (a+b \cos (c+d x))^2 \sec (c+d x) \, dx &=\frac {b^2 \sin (c+d x)}{d}+\int \left (a^2+2 a b \cos (c+d x)\right ) \sec (c+d x) \, dx\\ &=2 a b x+\frac {b^2 \sin (c+d x)}{d}+a^2 \int \sec (c+d x) \, dx\\ &=2 a b x+\frac {a^2 \tanh ^{-1}(\sin (c+d x))}{d}+\frac {b^2 \sin (c+d x)}{d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.02, size = 46, normalized size = 1.39 \begin {gather*} 2 a b x+\frac {a^2 \tanh ^{-1}(\sin (c+d x))}{d}+\frac {b^2 \cos (d x) \sin (c)}{d}+\frac {b^2 \cos (c) \sin (d x)}{d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.12, size = 43, normalized size = 1.30
method | result | size |
derivativedivides | \(\frac {a^{2} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+2 a b \left (d x +c \right )+b^{2} \sin \left (d x +c \right )}{d}\) | \(43\) |
default | \(\frac {a^{2} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+2 a b \left (d x +c \right )+b^{2} \sin \left (d x +c \right )}{d}\) | \(43\) |
risch | \(2 a b x -\frac {i b^{2} {\mathrm e}^{i \left (d x +c \right )}}{2 d}+\frac {i b^{2} {\mathrm e}^{-i \left (d x +c \right )}}{2 d}+\frac {a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{d}-\frac {a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{d}\) | \(84\) |
norman | \(\frac {2 a b x +\frac {2 b^{2} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}+\frac {2 b^{2} \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}+4 a b x \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+2 a b x \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{2}}+\frac {a^{2} \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{d}-\frac {a^{2} \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{d}\) | \(131\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.28, size = 42, normalized size = 1.27 \begin {gather*} \frac {2 \, {\left (d x + c\right )} a b + a^{2} \log \left (\sec \left (d x + c\right ) + \tan \left (d x + c\right )\right ) + b^{2} \sin \left (d x + c\right )}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.43, size = 52, normalized size = 1.58 \begin {gather*} \frac {4 \, a b d x + a^{2} \log \left (\sin \left (d x + c\right ) + 1\right ) - a^{2} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, b^{2} \sin \left (d x + c\right )}{2 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (a + b \cos {\left (c + d x \right )}\right )^{2} \sec {\left (c + d x \right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 78 vs.
\(2 (33) = 66\).
time = 0.50, size = 78, normalized size = 2.36 \begin {gather*} \frac {2 \, {\left (d x + c\right )} a b + a^{2} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - a^{2} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) + \frac {2 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1}}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.55, size = 73, normalized size = 2.21 \begin {gather*} \frac {b^2\,\sin \left (c+d\,x\right )}{d}+\frac {2\,a^2\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {4\,a\,b\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________